<?php
header('Content-Type: text/html; charset=utf-8');
/**
 * 网站入口
 */
define('PHPSELF', basename($_SERVER['SCRIPT_NAME'])); //文件名
define('ROOTPATH', dirname(dirname(str_replace(PHPSELF, '', str_replace('\\', '/', __FILE__)))));  //根目录
define('APPNAME',str_replace(dirname(dirname(str_replace('\\', '/', __FILE__))).'/', '', dirname(str_replace('\\', '/', __FILE__)))); //应用名称
define('APPPATH', ROOTPATH.'/app/'.APPNAME);  //应用名称
define('APP_PUBLIC', APPPATH.'/public');
define('DOMAIN', 'http://'.$_SERVER['SERVER_NAME']);
define('IMG_DOMAIN','http://image.dianshengsheng.com');

define('ENVIRONMENT', 'development');
if (defined('ENVIRONMENT')) {
    switch (ENVIRONMENT)
    {
        case 'development':
            error_reporting(E_ALL);
            ini_set('display_errors', '1');
            break;
        case 'testing':
            error_reporting(0);
            break;
        case 'production':
            error_reporting(0);
            break;

        default:
            exit('The app environment is not set correctly.');
    }
}


require_once(ROOTPATH.'/config/constant.config.php'); //常量
require_once(ROOTPATH.'/common/function.php');  //常用函数



//基类控制器
require_once ROOTPATH.'/core/controller.base.php';
require_once ROOTPATH.'/core/model.base.php';
//启动类
require_once ROOTPATH.'/core/server.class.php';

$server = new Server();
$server->run();




?>